/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2021/5/21
 * Time: 22:51
 */

#ifndef CODSEEGMENT_CUSTOMCHART_H
#define CODSEEGMENT_CUSTOMCHART_H
#include "CustomSeries.h"
#include <QtCharts>
QT_CHARTS_USE_NAMESPACE

class CustomChart
    : public QChart
{
    Q_OBJECT
public:
    CustomChart(QGraphicsItem * parent = nullptr, const Qt::WindowFlags & wFlags = nullptr);
    ~CustomChart() override = default;

    void ChangeSeries(CustomSeries * series);

public Q_SLOTS:
    void HandleBarClicked(int index, QBarSet * barset);

private:
    CustomSeries *     current_series_;

    QBarCategoryAxis * axisX_;
    QValueAxis *       axisY_;
};

#endif//CODSEEGMENT_CUSTOMCHART_H
